import random

secret = random.randint(1, 100)
count = 0

while True:
    guess = int(input("请猜一个1-100的整数："))
    count += 1
    if guess > secret:
        print("太大")
    elif guess < secret:
        print("太小")
    else:
        print(f"恭喜，猜中了！你一共猜了{count}次。")
        break